package com.xfatm.simplebrowser.ui;

import android.content.Context;
import android.graphics.Typeface;
import android.support.v7.widget.AppCompatButton;
import android.util.AttributeSet;
import android.widget.Button;

/**
 * Created by wenjie on 2018/3/12.
 */

public class FontIconButton extends AppCompatButton{
    public FontIconButton(Context context) {
        super(context);
        init();
    }

    public FontIconButton(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public FontIconButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    private void init(){
        //初始化字体图标
        Typeface iconfont = Typeface.createFromAsset(super.getContext().getAssets(), "iconfont.ttf");
        setTypeface(iconfont);
    }
}
